package com.cds.alert.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.cds.alert.dao.AlertPolicyAlarmSessionMapper;
import com.cds.alert.ibatis.Criteria;
import com.cds.alert.pojo.AlertPolicyAlarmSession;
import com.cds.alert.service.AlertPolicyAlarmSessionService;

@Service("alertPolicyAlarmSessionService")
public class AlertPolicyAlarmSessionServiceImpl implements AlertPolicyAlarmSessionService {

	@Autowired
	private AlertPolicyAlarmSessionMapper alertPolicyAlarmSessionMapper;
	
	@Transactional(readOnly = true)
	public AlertPolicyAlarmSession selectByPrimaryKey(Long id) {
		return alertPolicyAlarmSessionMapper.selectByPrimaryKey(id);
	}

	@Transactional(readOnly = true)
	public List<AlertPolicyAlarmSession> queryByExample(Criteria example) {
		return alertPolicyAlarmSessionMapper.queryByExample(example);
	}

	@Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = { Exception.class })
	public void insert(AlertPolicyAlarmSession entity) {
		alertPolicyAlarmSessionMapper.insert(entity);
	}
	
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = { Exception.class })
	public void deleteByPrimaryKey(Long id) {
		alertPolicyAlarmSessionMapper.deleteByPrimaryKey(id);
	}
	
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = { Exception.class })
	public void updateByPrimaryKey(AlertPolicyAlarmSession entity) {
		alertPolicyAlarmSessionMapper.updateByPrimaryKey(entity);
	}
	
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = { Exception.class })
	public void deleteByIds(List<Long> ids) {
		alertPolicyAlarmSessionMapper.deleteByIds(ids);
	}
}
